describe('practice-5-2', function () {

    it("证明哥德巴赫猜想是正确的", function () {
        var arr_result = gold_bach_conjecture([4,6,8,10]);
        for(var i = 0; i < arr_result.length; i ++)
        {
            var temp = arr_result[i];
            expect(judge_prime_num(temp.prime_num_a)).toBe(1);
            expect(judge_prime_num(temp.prime_num_b)).toBe(1);
        }
    });

});

function judge_prime_num(prime_num)
{
    var flag = 1;
    var k = Math.sqrt(prime_num);
    for(var j = 2;j <= k; j ++)
    {
        if(prime_num%j === 0)
        {
            flag = 0;
            break;
        }
    }
    return flag;
}